<template>
  <a-card :bordered="false" class="card-area">

    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
      </a-table>
    </div>

  </a-card>
</template>

<script>
import { httpAction, putAction, getAction, postAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'

export default {
  name: 'FamilyInfoForm',
  mixins: [JeecgListMixin],
  components: {},
  props: {
     patientId: Number,
  },
  watch: {
    patientId(newValue) {
      this.getPatient(newValue);
    }
  },
  data() {
    return {
      queryParam: {
        inhospitalId: 0
      },
      confirmLoading: false,
      disableMixinCreated: true,
      validatorRules: {},
      // 表头
      columns: [
        {
          title: '测评时间',
          align: 'center',
          dataIndex: 'createTime',
          width: 160
        },
        {
          title: '客户名称',
          align: 'center',
          dataIndex: 'patientName',
          width: 130
        },
        {
          title: '心脏健康指数',
          align: 'center',
          dataIndex: 'k',
          customRender: function(t, r, index) {
            return t.resultValue+"("+t.intervalBriefRemark+")"
          },
          width: 120
        },
        {
          title: '心脏年龄',
          align: 'center',
          dataIndex: 'h',
          customRender: function(t, r, index) {
            return t.resultValue+"("+t.intervalBriefRemark+")"
          },
          width: 120
        },
        {
          title: '血管硬化指数',
          align: 'center',
          dataIndex: 'l',
          customRender: function(t, r, index) {
            return t.resultValue+"("+t.intervalBriefRemark+")"
          },
          width: 120
        },
        {
          title: '体重指数 ',
          align: 'center',
          dataIndex: 'w',
          customRender: function(t, r, index) {
            return t.resultValue+"("+t.intervalBriefRemark+")"
          },
          width: 120
        },
        {
          title: '体质类型',
          align: 'center',
          dataIndex: 'c',
          customRender: function(t, r, index) {
            return t.resultValue
          },
          width: 120
        },
        {
          title: '危险因子数',
          align: 'center',
          dataIndex: 'd',
          customRender: function(t, r, index) {
            return t.resultValue+"("+t.intervalBriefRemark+")"
          },
          width: 120
        }, {
          title: '健康心脏年损失值',
          align: 'center',
          dataIndex: 'm',
          customRender: function(t, r, index) {
            return t.resultValue
          },
          width: 140
        }
      ],
      url: {
        list: '/ch/evaluation/result/list',
      }
    }
  },
  created() {
  },
  methods: {
    getPatient(patientId){
      this.queryParam.patientId = patientId
      this.loadData()
    },
  }
}
</script>

<style scoped>

</style>